<?
$maps = $this->maps;
?>

<div class="content-box">

    <div class="content-box-header">
        <h3>Quests</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Table</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <table>
                <thead>
                <tr>
                    <th>Title</th>
                    <th>Desc</th>
                    <th>Quest start</th>
                    <th>Quest end</th>
                    <th>Price</th>
                    <th>Postal</th>
                    <th></th>
                </tr>
                </thead>

                <tbody>
                <? foreach ($maps as $map): ?>
                <tr>
                    <td><?= $map['title'] ?></td>
                    <td><?= $this->truncate(strip_tags($map['description'])) ?></td>
                    <td><?= $map['datestart']->format('Y-m-d') ?></td>
                    <td><?= $map['dateend']->format('Y-m-d') ?></td>
                    <td><?= $map['price'] ?></td>
                    <td><?= $map['postal'] ?></td>
                    <td>
                        <a href="/quests/edit/id/<?= $map['id'] ?>">
                            <img src="/admin_/images/icons/pencil.png" alt="Edit">
                        </a>

                        <a href="/quests/delete/id/<?= $map['id'] ?>" class="delete">
                            <img alt="Delete" src="/admin_/images/icons/cross.png">
                        </a>

                        <a href="/quests/answers/id/<?= $map['id'] ?>">
                            <img alt="View answers" src="/admin_/images/icons/information.png">
                        </a>
                    </td>

                </tr>
                    <? endforeach;?>
                </tbody>

                <tfoot>
                <tr>
                    <td colspan="7"><a class="button" href="/quests/add">Add new</a></td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>